import React, { Component } from 'react'

class accountManage extends Component {
  constructor(props) {
    super(props)
    console.log('constructor')
    this.state = {
      name: 'Mark',
      Number: 1,
      time: '20190105 090522'
    }
  }
  // 盗墓笔记测试接口 axios
  allList = () => {
    let data = `盗墓笔记`
    this.$http.post(`/novelSearchApi?name=${data}`).then(res => {
      console.log(res)
    })
  }
  // 组件初始化时只调用，以后组件更新不调用，整个生命周期只调用一次，此时可以修改state。
  // 一般在这里更新数据，调用接口
  componentWillMount() {
    console.log('componentWillMount')
    let time = this.$moment(this.state.time).format('YYYY-MM-DD HH:mm:ss')
    console.log(time)
    this.allList()
  }
  render() {
    return <div>manage</div>
  }
}

export default accountManage
